package data;

import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement
public class Card {
	
	private Integer color;
	private Integer number;
	
	public Card() {
		super();
	}
	public Card (Integer color, Integer number) {
		this.setColor(color);
		this.setNumber(number);
	}
	
	public Card setColor(Integer color) {
		if (color == 1 || color == 2) {
			this.color = color;
		} else {
			this.color = Card.BLACK;
		}
		
		return this;
	}
	
	public Card setNumber (Integer number) {
		if (number >= Card.SEVEN && number <= Card.AS) {
			this.number = number;
		} else {
			this.number = Card.SEVEN;
		}
		
		return this;
	}
	
	public Integer getNumber() {
		return this.number;
	}
	public Integer getColor() {
		return this.color;
	}
	
	public static final Integer RED	= 1;
	public static final Integer BLACK	= 2;
	
	public static final Integer SEVEN	= 7;
	public static final Integer HEIGHT	= 8;
	public static final Integer NINE	= 9;
	public static final Integer TEN	= 10;
	public static final Integer JACK	= 11;
	public static final Integer QUEEN	= 12;
	public static final Integer KING	= 13;
	public static final Integer AS		= 14;
	
}
